﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>常春藤项目管理系统</title>
    <link rel="shortcut icon" href="__PUBLIC__/favicon.ico">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <script src="__PUBLIC__/scripts/boot.js" type="text/javascript"></script> 
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/scripts/miniui/themes/default/miniui.css" />
<!--<link rel="stylesheet" type="text/css" href="__PUBLIC__/scripts/miniui/themes/blue/skin.css" /> -->
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/scripts/miniui/themes/icons.css" /> 
    <style type="text/css">
    body{
        margin:0;padding:0;border:0;width:100%;height:100%;overflow:visible;
    }    
    .header
    {
        background:url(../header.gif) repeat-x 0 -1px;
    }
    </style>
</head>
<body>    
    
<!--Layout-->
<div id="layout1" class="mini-layout" style="width:100%;height:100%;">
    <div class="header" region="north" height="70" showSplit="false" showHeader="false">
        <h1 style="margin:0;padding:15px;cursor:default;font-family:微软雅黑,黑体,宋体;">常春藤项目管理系统</h1>
        <div style="position:absolute;top:18px;right:10px;">
			
			&nbsp;&nbsp;&nbsp;&nbsp;
        	<span>当前登录用户：{$_SESSION['nickname']}  </span>
        	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			
            <button id="mailbox" onclick="mailbox()"  >收件箱</button>
           <!--  <a id="mailbox" class="mini-button" iconCls="icon-addnew" plain="true" onclick="mailbox()">收件箱</a>  -->
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<button onclick="window.location.href='__APP__/Index/logout'" >注销</button>  
			
			
			
            
        </div>
        
    </div>
    <div title="south" region="south" showSplit="false" showHeader="false" height="30" >
        <div style="line-height:28px;text-align:center;cursor:default">Copyright © ivycapital &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<a href="mailto:hyhyxu@gmail.com;oursky2008@sjtu.edu.cn?subject=%B7%B4%C0%A1%BD%A8%D2%E9&cc=jianxia.shi@ivycapital.com" >反馈意见</a>
		</div>
    </div>
    <div title="center" region="center" style="border:0;" bodyStyle="overflow:hidden;">
        <!--Splitter-->
        <div class="mini-splitter" style="width:100%;height:100%;" borderStyle="border:0;">
            <div size="180" maxSize="250" minSize="200" showCollapseButton="true" style="border:0;">
                <!--OutlookTree-->
                <div id="leftTree" class="mini-outlooktree" url="__PUBLIC__/data/menu.txt" onnodeclick="onNodeSelect"
                    textField="text" idField="id" parentField="pid" contextMenu="#treeMenu"
                >
                </div>
                
            </div>
            <div showCollapseButton="false" style="border:0;">
                <!--Tabs-->
                <div id="mainTabs" class="mini-tabs bg-toolbar" activeIndex="0"   style="width:100%;height:100%;"  contextMenu="#tabsMenu" >
                    <div title="首页" url="__APP__/Index/news" >        
                    </div>                   
                </div>
				 <ul id="tabsMenu" class="mini-contextmenu" onbeforeopen="onBeforeOpen">        
					<li onclick="closeTab">关闭标签页</li>                
					<li onclick="closeAllBut">关闭其他标签页</li>
					<li onclick="closeAll">关闭所有标签页</li> 
					<li onclick="reload">刷新标签页</li>					
				</ul>
            </div>        
        </div>
    </div>
</div>

    <script type="text/javascript">
	mini.parse();

	setInterval(function(){
            jQuery.ajax({           
            type:"POST",          
            url:"__APP__/Index/timer",         
            global:false,           
            dataType:"json",           
            data:"action=ajax",           
            success:function(text){                                                          
                  
				 if(text["new"]=="yes")
					{
					jQuery("#mailbox").html("新消息"); 
					jQuery("#mailbox").css('color',"Red");
					}
				else
					{jQuery("#mailbox").html("收件箱"); 
					jQuery("#mailbox").css('color',"Black");}
            },           
            error:function(text)           
            {    //var data = mini.decode(text);
				 //alert("error");           
               //jQuery("#mailbox").html("新消息");               
            },            
        })
        }, 10000);
		
        
		
		var tabs = mini.get("mainTabs");
        var currentTab = null;
		
         tabs.on("beforecloseclick", function (e) {
         	e.cancel=true;
         	var iframe = tabs.getTabIFrameEl(tabs.getActiveTab()); 
         	if(iframe.contentWindow.getData)           	
         	{
         		if(iframe.contentWindow.getData()=="无变化")
         			iframe.contentWindow.CloseWindow('close');
         		else
				mini.confirm(iframe.contentWindow.getData()+"确定关闭？", "确定？",
            		function (action) {            
                if (action == "ok") {
                     iframe.contentWindow.CloseWindow('close');
                	 } 
            		 }
        		);
        		}
              else
              iframe.contentWindow.CloseWindow('close');
         		});
         		
        function showTab(node) {
            var tabs = mini.get("mainTabs");

            var id = "tab$" + node.id;
            var tab = tabs.getTab(id);
            if (!tab) {
                tab = {};
                tab.name = id;
                tab.title = node.text;
                tab.showCloseButton = true;
				tab.refreshOnClick=false;
				

                //这里拼接了url，实际项目，应该从后台直接获得完整的url地址
				if(node.id=="ckfinder")
				{
				
				window.open("http://112.64.130.166:8080/ivyproject/public/ckfinder/ckfinder.html");
				return;
				}
                if(node.pid=="pre" || node.pid=="update" || node.pid=="post" || node.pid=="quit"  )
                	  tab.url = "__APP__/Project/" + node.id;
                else
                	tab.url = "__APP__/" +node.pid+"/"+ node.id;
                
                

                tabs.addTab(tab);
            }
            else{
            	
            	tabs.reloadTab ( tab );
            }
            tabs.activeTab(tab);
            
            
        }
        
	
        function onNodeSelect(e) {
            var node = e.node;
            var isLeaf = e.isLeaf;

            if (isLeaf) {
                showTab(node);
            }
        }

        function onClick(e) {
            var text = this.getText();
            alert(text);
        }
		function mailbox(e){
	
		  var tabs = mini.get("mainTabs");
            var id = "tab$mailbox";
            var tab = tabs.getTab(id);

         if(tab) 
           {              
            tabs.reloadTab(tab);
            tabs.activeTab(tab);
            }

         else{  
                var tab =  {};
                tab.name = id;
                tab.title = "收件箱";
                tab.showCloseButton = true;
                tab.refreshOnClick=true;
            
                tab.url = "__APP__/Mail/mailbox";
                tabs.addTab(tab);
            
                tabs.activeTab(tab);
        }
                     		
		}
		
		function onBeforeOpen(e) {
            currentTab = tabs.getTabByEvent(e.htmlEvent);
            if (!currentTab) {
                e.cancel = true;                
            }
        }

	
        ///////////////////////////
        function closeTab() {
            tabs.removeTab(currentTab);
        }
        function closeAllBut() {
            tabs.removeAll(currentTab);
        }
        function closeAll() {
            tabs.removeAll();
		}
		function reload() {
            tabs.reloadTab ( currentTab );
		}
		function selectbypname(){
	
		mini.confirm("选择了项目："+mini.get("combo1").getValue(), "确定？",
		function (action) {
		if (action == "ok") {
		  var tabs = mini.get("mainTabs");
        
            var tab =  {};
                tab.name = id;
                tab.title = "项目基本信息";
                tab.showCloseButton = true;
				tab.refreshOnClick=true;
			
               	tab.url = "__APP__/Project/toinfo?pname="+mini.get("combo1").getValue();
                tabs.addTab(tab);
            
            tabs.activeTab(tab);
            
            
		}});}

        function selectproject(url){

          var tabs = mini.get("mainTabs");
           var id = "tab$info";
            var tab = tabs.getTab(id);
         if(tab) 
           {
                tab.url = url;
                tabs.reloadTab(tab);
                tabs.activeTab(tab);
            }
         else{  
                var tab =  {};
                tab.name = id;
                tab.title = "项目基本信息";
                tab.showCloseButton = true;
               
            
                tab.url = url;
                tabs.addTab(tab);
            
            tabs.activeTab(tab);
        }
        }
    </script>

    <!-- Piwik --> 
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://ivycapital2012.eicp.net:8080/piwik/" : "http://ivycapital2012.eicp.net:8080/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://ivycapital2012.eicp.net:8080/piwik/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->

</body>
</html>